from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv())

from openai import OpenAI
client = OpenAI(base_url="https://api.deepseek.com/beta")

prompt = """
# 计算参数指定范围内所有整数的和
```python
def fun(x, y):
"""

suffix = """
    return ret;
```
"""

response = client.completions.create(
    model="deepseek-chat",
    prompt=prompt,
    suffix=suffix,
    max_tokens=1024
)
print(response.choices[0].text)